package MessageOp;

import UserFriend.FriendConstant;
import serve.Constant;

import java.sql.SQLException;
import java.sql.Statement;

public class DeleteMessage
{
    public static void deleteMessage(String username)
    {
        try
        {
            String sql = "delete from %s where receiver=\"%s\"";
            sql = String.format(sql,FriendConstant.message_table,username);

            Statement stmt = Constant.chatdbConnector.getChatdb_connection().createStatement();
            stmt.executeUpdate(sql);
            stmt.close();
            //System.out.print("删除成功");
        }catch (SQLException e)
        {
            e.printStackTrace();
        }
    }
}
